import request from '@/utils/request'
//新增父级评论
export function addParentComment(data){
    return request({
        method: 'POST',
        url: '/commentservice/comment-parent/addParentCommentByPostIdAndToken',
        headers: {
          'Content-Type': 'application/json'
        },
        data
      }).then(res => res.data)
}
//获取最新父级评论
export function getParentComment(id,page,limit){
  return request({
      method: 'GET',
      url: `/commentservice/comment-parent/getCommentListByTokenAndPostIdOrderByCreatTime/${id}/${page}/${limit}`,
    }).then(res => res.data)
}

//删除父级评论
export function deleteParentComment(id,data){
  return request({
      method: 'DELETE',
      url: `/commentservice/comment-parent/deleteParentCommentById/${id}`,
      data
    }).then(res => res.data)
}

//获取最新父级评论
export function getLikesParentComment(id,page,limit){
  return request({
      method: 'GET',
      url: `/commentservice/comment-parent/getCommentListByTokenAndPostIdOrderByLike/${id}/${page}/${limit}`,
    }).then(res => res.data)
}
